
public class NameApp {

	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Name [] sons = new Name[3];	
		Name name = new Son1();
		Name name1 = new Son2();
		Name name2 = new Son3();
		
		
		sons[0] = name;
		sons[1] = name1;
		sons[2] = name2;
		
		displayNames(sons);
		System.out.println("Ouput String " + Capitalize("ERR"));
		
		
	}

	public static void displayNames(Name[] sons) {
		for(int i=0;i<sons.length;i++)
		{
			sons[i].TellName();
		}
	}
	
	private static String Capitalize(String mode)
	{
		System.out.println("Input String " + mode);
		if (mode.length() == 0) return mode;
			return mode.substring(0, 1).toUpperCase() + mode.substring(1).toLowerCase();  
		
			
	}

}
